<?php

namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\facade\Db;

class PageController extends HomebaseController{
	public function index() {

        $data = $this->request->param();
        $id=$data['id'];

        if(!$id){
            $reason='信息错误';
            $this->assign('reason', $reason);
            return $this->fetch(':error');
        }

        $page=Db::name("portal_post")->where(['id'=>$id])->find();
        $page['post_content']=html_entity_decode($page['post_content']);
        
        $this->assign('page', $page);
		
		return $this->fetch();
	}
}